]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
boxPointer: Add compatibility API
authorGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Fri, 27 Jul 2018 16:15:16 +0000 (13:15 -0300)
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Tue, 9 Oct 2018 01:43:01 +0000 (22:43 -0300)
Because we're late in the cycle, and don't know how many
extensions actually rely on this API, this commit adds
back the BoxPointer.show() and .hide() functions, with
warning messages to notify consumers that this is going
to be removed.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/153

js/ui/boxpointer.js

index acb1487b615789a67cdd6e0048bcd252801da851..f9394e3a7504d755de4eb03544aefea37b4e6189 100644 (file)
@@ -80,6 +80,36 @@ var BoxPointer = new Lang.Class({
         }
     },
 
+    // BoxPointer.show() and BoxPointer.hide() are here for only compatibility
+    // purposes, and will be removed in 3.32.
+    show(animate, onComplete) {
+        if (animate !== undefined) {
+            try {
+                throw new Error('BoxPointer.show() has been moved to BoxPointer.open(), this code will break in the future.');
+            } catch(e) {
+                logError(e);
+                this.open(animate, onComplete);
+                return;
+            }
+        }
+
+        this.visible = true;
+    },
+
+    hide(animate, onComplete) {
+        if (animate !== undefined) {
+            try {
+                throw new Error('BoxPointer.hide() has been moved to BoxPointer.close(), this code will break in the future.');
+            } catch(e) {
+                logError(e);
+                this.close(animate, onComplete);
+                return;
+            }
+        }
+
+        this.visible = false;
+    },
+
     open(animate, onComplete) {
         let themeNode = this.actor.get_theme_node();
         let rise = themeNode.get_length('-arrow-rise');